#include <stdio.h>

double getAvg(int *arr, int size);

int main()
{
    int arr[5] = {1, 2, 3, 4, 5};
    double avg;

    avg = getAvg(arr, 5);
    printf("avg = %.2f\n", avg);

    return 0;
}

double getAvg(int *arr, int size)
{
    int i, sum = 0;
    double avg;

    for (i = 0; i < size; i++)
    {
        // sum += *(arr + i);
        sum += arr[i];
    }

    avg = (double)sum / size;
    return avg;
}
